Plot Data
library(ggplot2)
# raw data
ggplot(dataset, aes(x=Veliparib, y=Counts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=FALSE, colour="#666666") +
geom_point(aes(colour=Treatment, shape=Experiment), size=2) +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)") +
scale_shape_manual(values=14:19) +
scale_color_manual(values=c("#999999","#0072B2","#CC79A7","#009E73"))

# Counts Linear
ggplot(dataset, aes(x=Veliparib, y=Counts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts Linear
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts2 Linear
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ x, se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# Counts Quadratic
ggplot(dataset, aes(x=Veliparib, y=Counts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts Quadratic
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts2 Quadratic
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# Counts Cubic
ggplot(dataset, aes(x=Veliparib, y=Counts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts Cubic
ggplot(dataset, aes(x=Veliparib, y=NormCounts)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

# NormCounts2 Cubic
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
theme_bw() +
theme(panel.grid=element_blank(), text = element_text(size=14)) +
geom_point(colour="#333333") +
geom_smooth(method=lm, formula = y ~ poly(x, 3), se=TRUE, colour="#666666") +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)")

library(Cairo)
cairo_pdf("FigureS1F_v1.pdf", width = 14, height = 4, family = "Arial")
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
theme_bw() +
theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(),
axis.line = element_line(colour = "black"), text = element_text(size=14),
panel.border = element_blank(), panel.background = element_blank()) +
geom_point(aes(colour = genotype)) +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)") +
ylab(label = "Normalized Counts") +
scale_color_manual(values=c('#000000','#800000','#000080','#808080'))
dev.off()
## quartz_off_screen
## 2
cairo_pdf("FigureS1F_v2.pdf", width = 6, height = 4, family = "Arial")
ggplot(dataset, aes(x=Veliparib, y=NormCounts2)) +
theme_bw() +
theme(panel.grid.major=element_blank(), panel.grid.minor=element_blank(),
axis.line = element_line(colour = "black"), text = element_text(size=14),
panel.border = element_blank(), panel.background = element_blank()) +
geom_point(aes(colour = genotype)) +
geom_smooth(method=lm, formula = y ~ poly(x, 2), se=TRUE, aes(colour = genotype), fill='#DDDDDD', size=0.5) +
#facet_grid(. ~ genotype) +
xlab(label = "Veliparib (log10 nM)") +
ylab(label = "Normalized Counts") +
scale_color_manual(values=c('#000000','#800000','#000080','#808080'))
dev.off()
## quartz_off_screen
## 2
Models
library(MASS)
library(DHARMa)
library(lme4)
library(lmerTest)
library(bbmle)
Linear formula
fit1 <- lm(Counts ~ Experiment + Veliparib*genotype, data = dataset)
print(summary(fit1))
##
## Call:
## lm(formula = Counts ~ Experiment + Veliparib * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -335.54 -93.08 -15.64 86.14 321.72
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 674.9382 68.5460 9.846 1.02e-14 ***
## Experimentexp2 136.2500 53.5830 2.543 0.01328 *
## Experimentexp3 138.2188 53.5830 2.580 0.01206 *
## Experimentexp4 182.7812 53.5830 3.411 0.00109 **
## Experimentexp5 97.9063 53.5830 1.827 0.07206 .
## Veliparib 4.6320 26.3783 0.176 0.86113
## genotypePARP1KO 53.3452 84.2627 0.633 0.52880
## genotypeALC1KO 165.5357 84.2627 1.965 0.05356 .
## genotypeALC1KO PARP1KO -7.0232 84.2627 -0.083 0.93382
## Veliparib:genotypePARP1KO -0.5895 37.3045 -0.016 0.98744
## Veliparib:genotypeALC1KO -124.9088 37.3045 -3.348 0.00133 **
## Veliparib:genotypeALC1KO PARP1KO -5.7200 37.3045 -0.153 0.87859
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 151.6 on 68 degrees of freedom
## Multiple R-squared: 0.3726, Adjusted R-squared: 0.2711
## F-statistic: 3.671 on 11 and 68 DF, p-value: 0.0004078
cat("AIC: ", AIC(fit1))
## AIC: 1043.381
simres <- simulateResiduals(fittedModel = fit1)
plot(simres)

fit2 <- lm(NormCounts ~ Veliparib*genotype, data = dataset)
print(summary(fit2))
##
## Call:
## lm(formula = NormCounts ~ Veliparib * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.34654 -0.03013 0.00492 0.04262 0.24803
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.986718 0.044077 22.386 < 2e-16 ***
## Veliparib 0.007149 0.019514 0.366 0.715
## genotypePARP1KO 0.004637 0.062334 0.074 0.941
## genotypeALC1KO 0.377392 0.062334 6.054 5.79e-08 ***
## genotypeALC1KO PARP1KO 0.010382 0.062334 0.167 0.868
## Veliparib:genotypePARP1KO -0.002496 0.027596 -0.090 0.928
## Veliparib:genotypeALC1KO -0.203135 0.027596 -7.361 2.38e-10 ***
## Veliparib:genotypeALC1KO PARP1KO -0.005588 0.027596 -0.202 0.840
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1121 on 72 degrees of freedom
## Multiple R-squared: 0.584, Adjusted R-squared: 0.5435
## F-statistic: 14.44 on 7 and 72 DF, p-value: 1.398e-11
cat("AIC: ", AIC(fit2))
## AIC: -113.5156
simres <- simulateResiduals(fittedModel = fit2)
plot(simres)

fit3 <- lm(NormCounts2 ~ Veliparib*genotype, data = dataset)
print(summary(fit3))
##
## Call:
## lm(formula = NormCounts2 ~ Veliparib * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.272255 -0.030392 0.005018 0.038240 0.194858
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.0072075 0.0360818 27.915 < 2e-16 ***
## Veliparib 0.0072976 0.0159740 0.457 0.649
## genotypePARP1KO 0.0008234 0.0510273 0.016 0.987
## genotypeALC1KO 0.0644802 0.0510273 1.264 0.210
## genotypeALC1KO PARP1KO 0.0096985 0.0510273 0.190 0.850
## Veliparib:genotypePARP1KO -0.0025660 0.0225906 -0.114 0.910
## Veliparib:genotypeALC1KO -0.1612701 0.0225906 -7.139 6.13e-10 ***
## Veliparib:genotypeALC1KO PARP1KO -0.0057055 0.0225906 -0.253 0.801
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.09178 on 72 degrees of freedom
## Multiple R-squared: 0.7256, Adjusted R-squared: 0.6989
## F-statistic: 27.19 on 7 and 72 DF, p-value: < 2.2e-16
cat("AIC: ", AIC(fit3))
## AIC: -145.5396
simres <- simulateResiduals(fittedModel = fit3)
plot(simres)

fit4 <- lmer(Counts ~ Veliparib*genotype + (1|UID), data = dataset)
print(summary(fit4))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ Veliparib * genotype + (1 | UID)
## Data: dataset
##
## REML criterion at convergence: 896.9
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.60756 -0.32454 0.07546 0.46297 1.88187
##
## Random effects:
## Groups Name Variance Std.Dev.
## UID (Intercept) 22911 151.36
## Residual 5555 74.53
## Number of obs: 80, groups: UID, 20
##
## Fixed effects:
## Estimate Std. Error df t value
## (Intercept) 785.9694 73.7617 19.9717 10.656
## Veliparib 4.6320 12.9727 56.0000 0.357
## genotypePARP1KO 53.3452 104.3148 19.9717 0.511
## genotypeALC1KO 165.5357 104.3148 19.9717 1.587
## genotypeALC1KO PARP1KO -7.0232 104.3148 19.9717 -0.067
## Veliparib:genotypePARP1KO -0.5895 18.3461 56.0000 -0.032
## Veliparib:genotypeALC1KO -124.9088 18.3461 56.0000 -6.808
## Veliparib:genotypeALC1KO PARP1KO -5.7200 18.3461 56.0000 -0.312
## Pr(>|t|)
## (Intercept) 1.09e-09 ***
## Veliparib 0.722
## genotypePARP1KO 0.615
## genotypeALC1KO 0.128
## genotypeALC1KO PARP1KO 0.947
## Veliparib:genotypePARP1KO 0.974
## Veliparib:genotypeALC1KO 7.17e-09 ***
## Veliparib:genotypeALC1KO PARP1KO 0.756
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) Velprb gPARP1 gALC1K gALC1P V:PARP V:ALC1
## Veliparib -0.327
## gntyPARP1KO -0.707 0.231
## gntypALC1KO -0.707 0.231 0.500
## gALC1KOPARP -0.707 0.231 0.500 0.500
## Vlp:PARP1KO 0.231 -0.707 -0.327 -0.163 -0.163
## Vlpr:ALC1KO 0.231 -0.707 -0.163 -0.327 -0.163 0.500
## V:ALC1KOPAR 0.231 -0.707 -0.163 -0.163 -0.327 0.500 0.500
cat("AIC: ", AIC(fit4))
## AIC: 916.9102
simres <- simulateResiduals(fittedModel = fit4)
plot(simres)

Quadratic formula
fit5 <- lm(Counts ~ Experiment + poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit5))
##
## Call:
## lm(formula = Counts ~ Experiment + poly(Veliparib, 2) * genotype,
## data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -260.14 -105.17 -19.45 93.83 315.92
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 683.544 47.766 14.310
## Experimentexp2 136.250 53.404 2.551
## Experimentexp3 138.219 53.404 2.588
## Experimentexp4 182.781 53.404 3.423
## Experimentexp5 97.906 53.404 1.833
## poly(Veliparib, 2)1 53.227 302.098 0.176
## poly(Veliparib, 2)2 -10.235 302.098 -0.034
## genotypePARP1KO 52.250 47.766 1.094
## genotypeALC1KO -66.525 47.766 -1.393
## genotypeALC1KO PARP1KO -17.650 47.766 -0.370
## poly(Veliparib, 2)1:genotypePARP1KO -6.774 427.230 -0.016
## poly(Veliparib, 2)2:genotypePARP1KO -16.849 427.230 -0.039
## poly(Veliparib, 2)1:genotypeALC1KO -1435.321 427.230 -3.360
## poly(Veliparib, 2)2:genotypeALC1KO -621.461 427.230 -1.455
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -65.728 427.230 -0.154
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -72.786 427.230 -0.170
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## Experimentexp2 0.01313 *
## Experimentexp3 0.01193 *
## Experimentexp4 0.00109 **
## Experimentexp5 0.07141 .
## poly(Veliparib, 2)1 0.86070
## poly(Veliparib, 2)2 0.97308
## genotypePARP1KO 0.27811
## genotypeALC1KO 0.16852
## genotypeALC1KO PARP1KO 0.71297
## poly(Veliparib, 2)1:genotypePARP1KO 0.98740
## poly(Veliparib, 2)2:genotypePARP1KO 0.96866
## poly(Veliparib, 2)1:genotypeALC1KO 0.00132 **
## poly(Veliparib, 2)2:genotypeALC1KO 0.15066
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO 0.87822
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO 0.86526
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 151 on 64 degrees of freedom
## Multiple R-squared: 0.4134, Adjusted R-squared: 0.2759
## F-statistic: 3.007 on 15 and 64 DF, p-value: 0.001112
cat("AIC: ", AIC(fit5))
## AIC: 1045.995
simres <- simulateResiduals(fittedModel = fit5)
plot(simres)

fit6 <- lm(NormCounts ~ poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit6))
##
## Call:
## lm(formula = NormCounts ~ poly(Veliparib, 2) * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.25205 -0.03344 0.00313 0.03484 0.31839
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.000e+00 2.244e-02 44.556
## poly(Veliparib, 2)1 8.215e-02 2.007e-01 0.409
## poly(Veliparib, 2)2 1.066e-02 2.007e-01 0.053
## genotypePARP1KO 3.252e-16 3.174e-02 0.000
## genotypeALC1KO 1.694e-16 3.174e-02 0.000
## genotypeALC1KO PARP1KO 2.603e-16 3.174e-02 0.000
## poly(Veliparib, 2)1:genotypePARP1KO -2.868e-02 2.839e-01 -0.101
## poly(Veliparib, 2)2:genotypePARP1KO -4.249e-02 2.839e-01 -0.150
## poly(Veliparib, 2)1:genotypeALC1KO -2.334e+00 2.839e-01 -8.222
## poly(Veliparib, 2)2:genotypeALC1KO -9.396e-01 2.839e-01 -3.310
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -6.421e-02 2.839e-01 -0.226
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -1.360e-01 2.839e-01 -0.479
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## poly(Veliparib, 2)1 0.6837
## poly(Veliparib, 2)2 0.9578
## genotypePARP1KO 1.0000
## genotypeALC1KO 1.0000
## genotypeALC1KO PARP1KO 1.0000
## poly(Veliparib, 2)1:genotypePARP1KO 0.9198
## poly(Veliparib, 2)2:genotypePARP1KO 0.8815
## poly(Veliparib, 2)1:genotypeALC1KO 8.66e-12 ***
## poly(Veliparib, 2)2:genotypeALC1KO 0.0015 **
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO 0.8217
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO 0.6335
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1004 on 68 degrees of freedom
## Multiple R-squared: 0.6851, Adjusted R-squared: 0.6342
## F-statistic: 13.45 on 11 and 68 DF, p-value: 3.537e-13
cat("AIC: ", AIC(fit6))
## AIC: -127.7917
simres <- simulateResiduals(fittedModel = fit6)
plot(simres)

fit7 <- lm(NormCounts2 ~ poly(Veliparib, 2)*genotype, data = dataset)
print(summary(fit7))
##
## Call:
## lm(formula = NormCounts2 ~ poly(Veliparib, 2) * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.198022 -0.034038 0.003194 0.033536 0.250135
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.0207653 0.0185689 54.972
## poly(Veliparib, 2)1 0.0838566 0.1660849 0.505
## poly(Veliparib, 2)2 0.0108811 0.1660849 0.066
## genotypePARP1KO -0.0039438 0.0262603 -0.150
## genotypeALC1KO -0.2351341 0.0262603 -8.954
## genotypeALC1KO PARP1KO -0.0009014 0.0262603 -0.034
## poly(Veliparib, 2)1:genotypePARP1KO -0.0294856 0.2348795 -0.126
## poly(Veliparib, 2)2:genotypePARP1KO -0.0432484 0.2348795 -0.184
## poly(Veliparib, 2)1:genotypeALC1KO -1.8531472 0.2348795 -7.890
## poly(Veliparib, 2)2:genotypeALC1KO -0.7407212 0.2348795 -3.154
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -0.0655611 0.2348795 -0.279
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -0.1386869 0.2348795 -0.590
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## poly(Veliparib, 2)1 0.6153
## poly(Veliparib, 2)2 0.9480
## genotypePARP1KO 0.8811
## genotypeALC1KO 4.09e-13 ***
## genotypeALC1KO PARP1KO 0.9727
## poly(Veliparib, 2)1:genotypePARP1KO 0.9005
## poly(Veliparib, 2)2:genotypePARP1KO 0.8545
## poly(Veliparib, 2)1:genotypeALC1KO 3.47e-11 ***
## poly(Veliparib, 2)2:genotypeALC1KO 0.0024 **
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO 0.7810
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO 0.5568
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08304 on 68 degrees of freedom
## Multiple R-squared: 0.7878, Adjusted R-squared: 0.7535
## F-statistic: 22.95 on 11 and 68 DF, p-value: < 2.2e-16
cat("AIC: ", AIC(fit7))
## AIC: -158.1159
simres <- simulateResiduals(fittedModel = fit7)
plot(simres)

fit8 <- lmer(Counts ~ poly(Veliparib, 2)*genotype + (1|UID), data = dataset)
print(summary(fit8))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Veliparib, 2) * genotype + (1 | UID)
## Data: dataset
##
## REML criterion at convergence: 809.3
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.10426 -0.43912 0.08385 0.44634 2.80603
##
## Random effects:
## Groups Name Variance Std.Dev.
## UID (Intercept) 23293 152.62
## Residual 4027 63.46
## Number of obs: 80, groups: UID, 20
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 794.575 69.713 16.000
## poly(Veliparib, 2)1 53.227 126.918 52.000
## poly(Veliparib, 2)2 -10.235 126.918 52.000
## genotypePARP1KO 52.250 98.589 16.000
## genotypeALC1KO -66.525 98.589 16.000
## genotypeALC1KO PARP1KO -17.650 98.589 16.000
## poly(Veliparib, 2)1:genotypePARP1KO -6.774 179.489 52.000
## poly(Veliparib, 2)2:genotypePARP1KO -16.849 179.489 52.000
## poly(Veliparib, 2)1:genotypeALC1KO -1435.321 179.489 52.000
## poly(Veliparib, 2)2:genotypeALC1KO -621.461 179.489 52.000
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -65.728 179.489 52.000
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -72.786 179.489 52.000
## t value Pr(>|t|)
## (Intercept) 11.398 4.32e-09 ***
## poly(Veliparib, 2)1 0.419 0.67667
## poly(Veliparib, 2)2 -0.081 0.93604
## genotypePARP1KO 0.530 0.60341
## genotypeALC1KO -0.675 0.50946
## genotypeALC1KO PARP1KO -0.179 0.86017
## poly(Veliparib, 2)1:genotypePARP1KO -0.038 0.97004
## poly(Veliparib, 2)2:genotypePARP1KO -0.094 0.92557
## poly(Veliparib, 2)1:genotypeALC1KO -7.997 1.29e-10 ***
## poly(Veliparib, 2)2:genotypeALC1KO -3.462 0.00108 **
## poly(Veliparib, 2)1:genotypeALC1KO PARP1KO -0.366 0.71571
## poly(Veliparib, 2)2:genotypeALC1KO PARP1KO -0.406 0.68676
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Correlation of Fixed Effects:
## (Intr) pl(V,2)1 pl(V,2)2 gPARP1 gALC1K gALC1P p(V,2)1:P p(V,2)2:P
## ply(Vlp,2)1 0.000
## ply(Vlp,2)2 0.000 0.000
## gntyPARP1KO -0.707 0.000 0.000
## gntypALC1KO -0.707 0.000 0.000 0.500
## gALC1KOPARP -0.707 0.000 0.000 0.500 0.500
## p(V,2)1:PAR 0.000 -0.707 0.000 0.000 0.000 0.000
## p(V,2)2:PAR 0.000 0.000 -0.707 0.000 0.000 0.000 0.000
## p(V,2)1:ALC 0.000 -0.707 0.000 0.000 0.000 0.000 0.500 0.000
## p(V,2)2:ALC 0.000 0.000 -0.707 0.000 0.000 0.000 0.000 0.500
## p(V,2)1:ALP 0.000 -0.707 0.000 0.000 0.000 0.000 0.500 0.000
## p(V,2)2:ALP 0.000 0.000 -0.707 0.000 0.000 0.000 0.000 0.500
## p(V,2)1:A p(V,2)2:A p(V,2)1P
## ply(Vlp,2)1
## ply(Vlp,2)2
## gntyPARP1KO
## gntypALC1KO
## gALC1KOPARP
## p(V,2)1:PAR
## p(V,2)2:PAR
## p(V,2)1:ALC
## p(V,2)2:ALC 0.000
## p(V,2)1:ALP 0.500 0.000
## p(V,2)2:ALP 0.000 0.500 0.000
cat("AIC: ", AIC(fit8))
## AIC: 837.2612
simres <- simulateResiduals(fittedModel = fit8)
plot(simres)

Cubic formula
fit9 <- lm(Counts ~ Experiment + poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit9))
##
## Call:
## lm(formula = Counts ~ Experiment + poly(Veliparib, 3) * genotype,
## data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -255.8 -114.4 -9.1 89.7 320.2
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 683.544 49.082 13.927
## Experimentexp2 136.250 54.875 2.483
## Experimentexp3 138.219 54.875 2.519
## Experimentexp4 182.781 54.875 3.331
## Experimentexp5 97.906 54.875 1.784
## poly(Veliparib, 3)1 53.227 310.423 0.171
## poly(Veliparib, 3)2 -10.235 310.423 -0.033
## poly(Veliparib, 3)3 186.106 310.423 0.600
## genotypePARP1KO 52.250 49.082 1.065
## genotypeALC1KO -66.525 49.082 -1.355
## genotypeALC1KO PARP1KO -17.650 49.082 -0.360
## poly(Veliparib, 3)1:genotypePARP1KO -6.774 439.004 -0.015
## poly(Veliparib, 3)2:genotypePARP1KO -16.849 439.004 -0.038
## poly(Veliparib, 3)3:genotypePARP1KO -64.937 439.004 -0.148
## poly(Veliparib, 3)1:genotypeALC1KO -1435.321 439.004 -3.269
## poly(Veliparib, 3)2:genotypeALC1KO -621.461 439.004 -1.416
## poly(Veliparib, 3)3:genotypeALC1KO -259.748 439.004 -0.592
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -65.728 439.004 -0.150
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -72.786 439.004 -0.166
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -120.120 439.004 -0.274
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## Experimentexp2 0.01585 *
## Experimentexp3 0.01446 *
## Experimentexp4 0.00149 **
## Experimentexp5 0.07946 .
## poly(Veliparib, 3)1 0.86444
## poly(Veliparib, 3)2 0.97381
## poly(Veliparib, 3)3 0.55108
## genotypePARP1KO 0.29135
## genotypeALC1KO 0.18038
## genotypeALC1KO PARP1KO 0.72041
## poly(Veliparib, 3)1:genotypePARP1KO 0.98774
## poly(Veliparib, 3)2:genotypePARP1KO 0.96951
## poly(Veliparib, 3)3:genotypePARP1KO 0.88290
## poly(Veliparib, 3)1:genotypeALC1KO 0.00179 **
## poly(Veliparib, 3)2:genotypeALC1KO 0.16206
## poly(Veliparib, 3)3:genotypeALC1KO 0.55629
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO 0.88149
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO 0.86887
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO 0.78532
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 155.2 on 60 degrees of freedom
## Multiple R-squared: 0.4194, Adjusted R-squared: 0.2355
## F-statistic: 2.281 on 19 and 60 DF, p-value: 0.008142
cat("AIC: ", AIC(fit9))
## AIC: 1053.182
simres <- simulateResiduals(fittedModel = fit9)
plot(simres)

fit10 <- lm(NormCounts ~ poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit10))
##
## Call:
## lm(formula = NormCounts ~ poly(Veliparib, 3) * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.255295 -0.028267 0.000888 0.036645 0.315147
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.000e+00 2.266e-02 44.133
## poly(Veliparib, 3)1 8.215e-02 2.027e-01 0.405
## poly(Veliparib, 3)2 1.066e-02 2.027e-01 0.053
## poly(Veliparib, 3)3 2.557e-01 2.027e-01 1.262
## genotypePARP1KO 2.914e-16 3.204e-02 0.000
## genotypeALC1KO 2.365e-16 3.204e-02 0.000
## genotypeALC1KO PARP1KO 2.554e-16 3.204e-02 0.000
## poly(Veliparib, 3)1:genotypePARP1KO -2.868e-02 2.866e-01 -0.100
## poly(Veliparib, 3)2:genotypePARP1KO -4.249e-02 2.866e-01 -0.148
## poly(Veliparib, 3)3:genotypePARP1KO -1.094e-01 2.866e-01 -0.382
## poly(Veliparib, 3)1:genotypeALC1KO -2.334e+00 2.866e-01 -8.144
## poly(Veliparib, 3)2:genotypeALC1KO -9.396e-01 2.866e-01 -3.278
## poly(Veliparib, 3)3:genotypeALC1KO -3.574e-01 2.866e-01 -1.247
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -6.421e-02 2.866e-01 -0.224
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -1.360e-01 2.866e-01 -0.474
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -1.354e-01 2.866e-01 -0.473
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## poly(Veliparib, 3)1 0.68657
## poly(Veliparib, 3)2 0.95822
## poly(Veliparib, 3)3 0.21165
## genotypePARP1KO 1.00000
## genotypeALC1KO 1.00000
## genotypeALC1KO PARP1KO 1.00000
## poly(Veliparib, 3)1:genotypePARP1KO 0.92061
## poly(Veliparib, 3)2:genotypePARP1KO 0.88261
## poly(Veliparib, 3)3:genotypePARP1KO 0.70396
## poly(Veliparib, 3)1:genotypeALC1KO 1.8e-11 ***
## poly(Veliparib, 3)2:genotypeALC1KO 0.00169 **
## poly(Veliparib, 3)3:genotypeALC1KO 0.21693
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO 0.82344
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO 0.63681
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO 0.63813
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.1013 on 64 degrees of freedom
## Multiple R-squared: 0.6979, Adjusted R-squared: 0.6271
## F-statistic: 9.858 on 15 and 64 DF, p-value: 1.611e-11
cat("AIC: ", AIC(fit10))
## AIC: -123.1178
simres <- simulateResiduals(fittedModel = fit10)
plot(simres)

fit11 <- lm(NormCounts2 ~ poly(Veliparib, 3)*genotype, data = dataset)
print(summary(fit11))
##
## Call:
## lm(formula = NormCounts2 ~ poly(Veliparib, 3) * genotype, data = dataset)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.200568 -0.028806 0.000905 0.035779 0.247589
##
## Coefficients:
## Estimate Std. Error t value
## (Intercept) 1.0207653 0.0185618 54.993
## poly(Veliparib, 3)1 0.0838566 0.1660217 0.505
## poly(Veliparib, 3)2 0.0108811 0.1660217 0.066
## poly(Veliparib, 3)3 0.2610037 0.1660217 1.572
## genotypePARP1KO -0.0039438 0.0262503 -0.150
## genotypeALC1KO -0.2351341 0.0262503 -8.957
## genotypeALC1KO PARP1KO -0.0009014 0.0262503 -0.034
## poly(Veliparib, 3)1:genotypePARP1KO -0.0294856 0.2347902 -0.126
## poly(Veliparib, 3)2:genotypePARP1KO -0.0432484 0.2347902 -0.184
## poly(Veliparib, 3)3:genotypePARP1KO -0.1122415 0.2347902 -0.478
## poly(Veliparib, 3)1:genotypeALC1KO -1.8531472 0.2347902 -7.893
## poly(Veliparib, 3)2:genotypeALC1KO -0.7407212 0.2347902 -3.155
## poly(Veliparib, 3)3:genotypeALC1KO -0.3409188 0.2347902 -1.452
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -0.0655611 0.2347902 -0.279
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -0.1386869 0.2347902 -0.591
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -0.1383653 0.2347902 -0.589
## Pr(>|t|)
## (Intercept) < 2e-16 ***
## poly(Veliparib, 3)1 0.61523
## poly(Veliparib, 3)2 0.94795
## poly(Veliparib, 3)3 0.12086
## genotypePARP1KO 0.88105
## genotypeALC1KO 6.71e-13 ***
## genotypeALC1KO PARP1KO 0.97272
## poly(Veliparib, 3)1:genotypePARP1KO 0.90046
## poly(Veliparib, 3)2:genotypePARP1KO 0.85444
## poly(Veliparib, 3)3:genotypePARP1KO 0.63424
## poly(Veliparib, 3)1:genotypeALC1KO 4.98e-11 ***
## poly(Veliparib, 3)2:genotypeALC1KO 0.00245 **
## poly(Veliparib, 3)3:genotypeALC1KO 0.15138
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO 0.78097
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO 0.55681
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO 0.55772
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.08301 on 64 degrees of freedom
## Multiple R-squared: 0.8004, Adjusted R-squared: 0.7537
## F-statistic: 17.11 on 15 and 64 DF, p-value: < 2.2e-16
cat("AIC: ", AIC(fit11))
## AIC: -155.0267
simres <- simulateResiduals(fittedModel = fit11)
plot(simres)

fit12 <- lmer(Counts ~ poly(Veliparib, 3)*genotype + (1|UID), data = dataset)
print(summary(fit12))
## Linear mixed model fit by REML. t-tests use Satterthwaite's method [
## lmerModLmerTest]
## Formula: Counts ~ poly(Veliparib, 3) * genotype + (1 | UID)
## Data: dataset
##
## REML criterion at convergence: 759.5
##
## Scaled residuals:
## Min 1Q Median 3Q Max
## -2.13289 -0.38846 0.01958 0.41728 2.75890
##
## Random effects:
## Groups Name Variance Std.Dev.
## UID (Intercept) 23286 152.60
## Residual 4055 63.68
## Number of obs: 80, groups: UID, 20
##
## Fixed effects:
## Estimate Std. Error df
## (Intercept) 794.575 69.713 16.000
## poly(Veliparib, 3)1 53.227 127.355 48.000
## poly(Veliparib, 3)2 -10.235 127.355 48.000
## poly(Veliparib, 3)3 186.106 127.355 48.000
## genotypePARP1KO 52.250 98.589 16.000
## genotypeALC1KO -66.525 98.589 16.000
## genotypeALC1KO PARP1KO -17.650 98.589 16.000
## poly(Veliparib, 3)1:genotypePARP1KO -6.774 180.107 48.000
## poly(Veliparib, 3)2:genotypePARP1KO -16.849 180.107 48.000
## poly(Veliparib, 3)3:genotypePARP1KO -64.937 180.107 48.000
## poly(Veliparib, 3)1:genotypeALC1KO -1435.321 180.107 48.000
## poly(Veliparib, 3)2:genotypeALC1KO -621.461 180.107 48.000
## poly(Veliparib, 3)3:genotypeALC1KO -259.748 180.107 48.000
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -65.728 180.107 48.000
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -72.786 180.107 48.000
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -120.120 180.107 48.000
## t value Pr(>|t|)
## (Intercept) 11.398 4.32e-09 ***
## poly(Veliparib, 3)1 0.418 0.67786
## poly(Veliparib, 3)2 -0.080 0.93628
## poly(Veliparib, 3)3 1.461 0.15044
## genotypePARP1KO 0.530 0.60341
## genotypeALC1KO -0.675 0.50946
## genotypeALC1KO PARP1KO -0.179 0.86017
## poly(Veliparib, 3)1:genotypePARP1KO -0.038 0.97016
## poly(Veliparib, 3)2:genotypePARP1KO -0.094 0.92586
## poly(Veliparib, 3)3:genotypePARP1KO -0.361 0.72002
## poly(Veliparib, 3)1:genotypeALC1KO -7.969 2.45e-10 ***
## poly(Veliparib, 3)2:genotypeALC1KO -3.451 0.00118 **
## poly(Veliparib, 3)3:genotypeALC1KO -1.442 0.15574
## poly(Veliparib, 3)1:genotypeALC1KO PARP1KO -0.365 0.71676
## poly(Veliparib, 3)2:genotypeALC1KO PARP1KO -0.404 0.68792
## poly(Veliparib, 3)3:genotypeALC1KO PARP1KO -0.667 0.50801
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
cat("AIC: ", AIC(fit12))
## AIC: 795.4916
simres <- simulateResiduals(fittedModel = fit12)
plot(simres)

Final Result
fit <- fit7
output <- coef(summary(fit))
output <- output[grep("Veliparib", rownames(output)),]
rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype", paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1], sep = " in " )
# suggested result table
kable(output, row.names = T)
| Veliparib1 in WT |
0.0838566 |
0.1660849 |
0.5049021 |
0.6152600 |
| Veliparib2 in WT |
0.0108811 |
0.1660849 |
0.0655156 |
0.9479557 |
| Veliparib1: WT vs. PARP1KO |
-0.0294856 |
0.2348795 |
-0.1255350 |
0.9004704 |
| Veliparib2: WT vs. PARP1KO |
-0.0432484 |
0.2348795 |
-0.1841303 |
0.8544592 |
| Veliparib1: WT vs. ALC1KO |
-1.8531472 |
0.2348795 |
-7.8897775 |
0.0000000 |
| Veliparib2: WT vs. ALC1KO |
-0.7407212 |
0.2348795 |
-3.1536221 |
0.0024007 |
| Veliparib1: WT vs. ALC1KO PARP1KO |
-0.0655611 |
0.2348795 |
-0.2791267 |
0.7809948 |
| Veliparib2: WT vs. ALC1KO PARP1KO |
-0.1386869 |
0.2348795 |
-0.5904595 |
0.5568399 |
write.table(output, file = "FigureS1F_Stats_Ref_WT.txt", quote = F, sep = "\t", row.names = T, col.names = NA)
# re-fit with ALC1KO reference
dataset$genotype <- relevel(dataset$genotype, ref = "ALC1KO")
fit <- lm(NormCounts2 ~ poly(Veliparib,2)*genotype, data = dataset)
output <- coef(summary(fit))
output <- output[grep("Veliparib", rownames(output)),]
rownames(output) <- gsub("poly\\(|, [1-3]\\)","", rownames(output) )
rownames(output) <- gsub("genotype", paste0(" ",levels(dataset$genotype)[1], " vs. "), rownames(output))
rownames(output)[!(grepl("vs", rownames(output)))] <- paste(rownames(output)[!(grepl("vs", rownames(output)))], levels(dataset$genotype)[1], sep = " in " )
# suggested result table
kable(output, row.names = T)
| Veliparib1 in ALC1KO |
-1.7692906 |
0.1660849 |
-10.652928 |
0.0000000 |
| Veliparib2 in ALC1KO |
-0.7298401 |
0.1660849 |
-4.394380 |
0.0000399 |
| Veliparib1: ALC1KO vs. WT |
1.8531472 |
0.2348795 |
7.889778 |
0.0000000 |
| Veliparib2: ALC1KO vs. WT |
0.7407212 |
0.2348795 |
3.153622 |
0.0024007 |
| Veliparib1: ALC1KO vs. PARP1KO |
1.8236616 |
0.2348795 |
7.764243 |
0.0000000 |
| Veliparib2: ALC1KO vs. PARP1KO |
0.6974728 |
0.2348795 |
2.969492 |
0.0041179 |
| Veliparib1: ALC1KO vs. ALC1KO PARP1KO |
1.7875860 |
0.2348795 |
7.610651 |
0.0000000 |
| Veliparib2: ALC1KO vs. ALC1KO PARP1KO |
0.6020344 |
0.2348795 |
2.563162 |
0.0125894 |
write.table(output, file = "FigureS1F_Stats_Ref_ALC1KO.txt", quote = F, sep = "\t", row.names = T, col.names = NA)